//
//  YQConsultantView.m
//  OverseasImmigration
//
//  Created by yuqin on 2019/6/4.
//  Copyright © 2019年 yuqin. All rights reserved.
//

#import "YQConsultantView.h"
#import "YQConsultantCell.h"

@interface YQConsultantView ()<UITableViewDelegate,UITableViewDataSource>

@property (nonatomic, strong) UITableView *consultantTB;

@end

@implementation YQConsultantView

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self setupConsultantView];
    }
    return self;
}

- (NSMutableArray *)dataArr {
    if (!_dataArr) {
        _dataArr = [NSMutableArray array];
    }
    return _dataArr;
}

- (void)setupConsultantView {
    self.consultantTB = [[UITableView alloc] initWithFrame:CGRectMake(0, 20, SCREENHEIGHT, SCREENHEIGHT-kNavigationBarHeight-FIT(380)) style:UITableViewStylePlain];
    self.consultantTB.delegate = self;
    self.consultantTB.dataSource = self;
    [self addSubview:self.consultantTB];
    [self.consultantTB registerNib:[UINib nibWithNibName:@"YQConsultantCell" bundle:nil] forCellReuseIdentifier:@"YQConsultantCell"];
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
//    return self.dataArr.count;
    return 5;
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
    return FIT(100);
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    YQConsultantCell *cell = [tableView dequeueReusableCellWithIdentifier:@"YQConsultantCell" forIndexPath:indexPath];
    return cell;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    [tableView deselectRowAtIndexPath:indexPath animated:NO];
}

@end
